package com.szdvte.news.dao.impl;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import com.szdvte.news.bean.NewsFilmResource;
import com.szdvte.news.dao.INewsFilmResourceDao;

public class NewsFilmResourceDaoImpl extends BaseDaoImpl implements
		INewsFilmResourceDao {

	@SuppressWarnings("unchecked")
	@Override
	public List<NewsFilmResource> selectPic(NewsFilmResource newsFilmResource) {
		List<NewsFilmResource> list = new ArrayList<NewsFilmResource>();
		try {
			list = this.getSqlMapClient().queryForList("newsFilmResource.selectPic",newsFilmResource);
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return list;
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<NewsFilmResource> select(NewsFilmResource newsFilmResource) {
		List<NewsFilmResource> list = new ArrayList<NewsFilmResource>();
		try {
			list = this.getSqlMapClient().queryForList("newsFilmResource.select",newsFilmResource);
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return list;
	}

	@Override
	public boolean delete(NewsFilmResource newsFilmResource) {
		boolean flag = false;
		try {
			getSqlMapClient().update("newsFilmResource.delete",newsFilmResource);
			flag = true;
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return flag;
		
	}

	@Override
	public boolean add(NewsFilmResource newsFilmResource) {
		boolean flag = false;
		try {
			getSqlMapClient().insert("newsFilmResource.add",newsFilmResource);
			flag = true;
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return flag;
	}

	@Override
	public boolean update(NewsFilmResource newsFilmResource) {
		boolean flag = false;
		try {
			getSqlMapClient().update("newsFilmResource.update",newsFilmResource);
			flag = true;
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return flag;
	}

}
